Optical positioning system and operating method thereof

ABSTRACT

There is provided an operating method of an optical positioning system including: capturing an image frame of a detected surface, which has interleaved bright regions and dark regions, using a field of view and a shutter time of an optical sensor counting a number of edge pairs between the bright regions and the dark regions that the field of view passes; calculating an average value of the image frame; calculating a ratio between the calculated average value and the shutter time; determining that the field of view is aligned with one of the dark regions when the ratio is smaller than a ratio threshold; and determining that the field of view is aligned with one of the bright regions when the ratio is larger than the ratio threshold.

BACKGROUND 1. Field of the Disclosure

This disclosure generally relates to an optical positioning system and,more particularly, to an optical positioning system having a higherresolution than positioning based on mark edges only.

2. Description of the Related Art

The optical positioning device is used to detect a position thereofcorresponding to a strip or a rotation angle of a shaft, and has thebenefits of a small size and low power. Furthermore, as a probe head ofthe optical positioning device is not directly in contact with thesurface under detection, there will be no abrasion to the probe head.

An optical positioning device having a high resolution is required.

SUMMARY

The present disclosure provides an optical positioning system that candetermine a current position at mark edges and between mark edges toincrease the resolution twofold.

The present disclosure further provides an optical positioning systemthat determines a current position using different formulascorresponding to a dark-to-bright edge, a bright-to-dark edge, a brightregion or a dark region on a surface under detection.

The present disclosure provides an optical positioning system includinga detected surface, an optical sensor, a counter, a register and aprocessor. The detected surface has interleaved bright regions and darkregions arranged in a transverse direction. The optical sensor isconfigured to capture an image frame of the detected surface within afield of view thereof and using a shutter time, wherein the detectedsurface and the optical sensor are configured to have a relativemovement in the transverse direction. The counter is configured to counta number of edge pairs between the bright regions and the dark regionsthat the field of view passes. The register is configured to record atype of a last passed edge. The processor is configured to calculate anaverage value of the image frame, determine whether the field of view isaligned with an edge between the bright regions and the dark regionsaccording to a brightness distribution in the image frame, compare aratio between the average value and the shutter time with a ratiothreshold to determine whether the field of view is aligned with one ofthe bright regions or the dark regions, determine an integer positionaccording to the counted number of edge pairs without using the lastpassed edge or the ratio when the field of view is determined to bealigned with the edge, and determine a half position according to thecounted number of edge pairs, the last passed edge and the ratio whenthe field of view is determined to be aligned with one of the brightregions or the dark regions.

The present disclosure further provides an optical positioning systemincluding a detected surface, an optical sensor, a counter and aprocessor. The detected surface has interleaved bright regions and darkregions arranged in a transverse direction. The optical sensor isconfigured to capture image frames of the detected surface within afield of view thereof and using a shutter time, wherein the detectedsurface and the optical sensor are configured to have a relativemovement in the transverse direction. The counter is configured to counta number of edge pairs between the bright regions and the dark regionsthat the field of view passes. The processor is configured to calculatean average value of a current image frame and a moving directionaccording to multiple image frames, determine whether the field of viewis aligned with an edge between the bright regions and the dark regionsaccording to a brightness distribution in the current image frame,compare a ratio between the average value and the shutter time with aratio threshold to determine whether the field of view is aligned withone of the bright regions or the dark regions, determine an integerposition according to the counted number of edge pairs without using themoving direction or the ratio when the field of view is determined to bealigned with the edge, and determine a half position according to thecounted number of edge pairs, the moving direction and the ratio whenthe field of view is determined to be aligned with one of the brightregions or the dark regions.

The present disclosure further provides an operating method of anoptical positioning system. The optical positioning system includes adetected surface, an optical sensor and a processor. The operatingmethod includes the steps of: capturing an image frame of the detectedsurface, which has interleaved bright regions and dark regions, within afield of view of the optical sensor using a shutter time; counting, bythe processor, a number of edge pairs between the bright regions and thedark regions that the field of view passes in a transverse direction;calculating, by the processor, an average value of the image frame;calculating, by the processor, a ratio between the calculated averagevalue and the shutter time; determining that the field of view isaligned with one of the dark regions when the ratio is smaller than apredetermined ratio threshold; and determining that the field of view isaligned with one of the bright regions when the ratio is larger than thepredetermined ratio threshold.

The present disclosure further provides an optical positioning systemincluding a detected surface, an optical sensor and a processor. Thedetected surface has interleaved bright regions and dark regions. Theoptical sensor is configured to capture an image frame of the detectedsurface within a field of view thereof and using a shutter time. Theprocessor is configured to count a number of edge pairs between thebright regions and the dark regions that the field of view passes in atransverse direction, calculate an average value of the image frame anda ratio of the calculated average value to the shutter time, determinethat the field of view is aligned with one of the dark regions when theratio is smaller than a predetermined ratio threshold, and determinethat the field of view is aligned with one of the bright regions whenthe ratio is larger than the predetermined ratio threshold.

In the present disclosure, the integer position is referred to aposition corresponding to mark edges, and the half position is referredto a position within bright regions or dark regions.

BRIEF DESCRIPTION OF THE DRAWINGS

Other objects, advantages, and novel features of the present disclosurewill become more apparent from the following detailed description whentaken in conjunction with the accompanying drawings.

FIG. 1 is a schematic diagram of an optical positioning system accordingto one embodiment of the present disclosure.

FIG. 2 is an operational schematic diagram of an optical positioningsystem according to one embodiment of the present disclosure.

FIG. 3 is another operational schematic diagram of an opticalpositioning system according to one embodiment of the presentdisclosure.

FIG. 4 is an alternative operational schematic diagram of an opticalpositioning system according to one embodiment of the presentdisclosure.

FIG. 5 is an alternative operational schematic diagram of an opticalpositioning system according to one embodiment of the presentdisclosure.

FIG. 6 is a flow chart of an operating method of an optical positioningsystem according to one embodiment of the present disclosure.

FIG. 7 is a flow chart of an operating method of an optical positioningsystem according to another embodiment of the present disclosure.

DETAILED DESCRIPTION OF THE EMBODIMENT

It should be noted that, wherever possible, the same reference numberswill be used throughout the drawings to refer to the same or like parts.

The present disclosure provides an optical positioning system capable ofdetecting an absolute position even when the field of view (FOV) of anoptical sensor does not see an edge of marks. Furthermore, the opticalpositioning system of the present disclosure further distinguisheswhether the field of view of an optical sensor is focused on a mark oron a space between two marks according to an average value of one imageframe to a shutter time for capturing said image frame. In this way, thepositional resolution of the optical positioning system is increasedtwofold.

Referring to FIG. 1, it is a schematic diagram of an optical positioningsystem 100 according to one embodiment of the present disclosure. Theoptical positioning system 100 includes a detected surface 11, anoptical sensor 13, a processor 15, a counter 17 and a memory 19.

It should be mentioned that although FIG. 1 shows that the counter 17and the memory 19 are separated from the processor 15, the presentdisclosure is not limited thereto. In other aspects, the counter 17 andthe memory 19 are integrated in the processor 15, i.e. operations of thecounter 17 and the memory 19 being executed by the processor 15.

In some aspects, the optical positioning system 100 of the presentdisclosure is wired or wirelessly coupled to an external host 9 thatcalculates an absolute position according to a number of edge pairs(shown as #LC) being counted and a type of last passed edge (shown asPedge) outputted by the processor 15, e.g., according to formulasmentioned below, and performs a corresponding control according to thecalculated absolute position. The control performed by the host 9 isknown to the art and is not a main objective of the present disclosure,and thus details thereof are not described herein. In this case, theformulas (1) to (5) mentioned below are embedded in the host 9.

In some aspects, the processor 15 directly calculates a position or anangle according to a line number (e.g., #LC) and a last see edge (e.g.,Pedge), and then outputs the calculated position or angle to the host 9for the corresponding control. That is, the formulas (1) to (5)mentioned below are embedded in the optical positioning system 100,e.g., stored in the memory 19.

The detected surface 11 is a surface of a strip (e.g., a plane surface)or a shaft (e.g., a curved surface) on which interleaved bright regions(blank rectangles) 11B and dark regions (filled rectangles) 11D arearranged in a transverse direction, e.g., a left-right direction inFIG. 1. In the case that the bright regions 11B and the dark regions 11Dare arranged on a shaft surface, the transverse direction is referred toa rotation direction of the shaft. To simplify the calculation of acurrent position, the bright regions 11B and the dark regions 11D havean identical width in the transverse direction, e.g., FIGS. 2-5 taking 1mm as an example for illustration purposes. By sputtering or coating aplurality of marks (i.e., dark regions 11D herein) separated by apredetermined distance (e.g., the mark width) on the detected surface11, it is able to form the interleaved bright regions 11B and darkregions 11D as shown in FIG. 1.

It should be mentioned that the dark regions 11D mentioned herein arenot limited to be black color as long as the dark regions 11D have lowerreflectivity than the bright regions 11B. Accordingly in other aspects,by sputtering or coating a plurality of reflecting layers (i.e., brightregions 11B herein), separated by a predetermined distance (e.g., awidth of reflecting layers) on the detected surface 11, it is alsopossible to form the interleaved bright regions 11B and dark regions 11Das shown in FIG. 1. More specifically, materials and manufacturing ofthe bright regions 11B and dark regions 11D are not particularly limitedas long as the bright regions 11B and dark regions 11D aredistinguishable in the captured image frame, shown as IF in FIG. 1.

The optical sensor 13 is a CCD image sensor, a CMOS image sensor or thelike, and has a field of view (FOV) having a range θ as shown in FIG. 1.In the present disclosure, the field of view of the optical sensor 13 inthe transverse direction is preferably smaller than the identical width(i.e. the mark width). The relationship between the field of view of theoptical sensor 13 in a direction perpendicular to the transversedirection and a height of marks is not particularly limited.

The optical sensor 13 captures every image frame IF of the detectedsurface 11 within a field of view θ thereof and using a shutter time.The shutter time is determined by auto exposure of the optical sensor13, and the auto exposure mechanism of optical sensor is known to theart and thus details thereof are not described herein. When the opticalpositioning system 100 is in operation, the detected surface 11 and theoptical sensor 13 have a relative movement in the transverse directionno matter which of the detected surface 11 or the optical sensor 13 isactually in motion.

The counter 17 counts a number of edge pairs between the bright regions11B and the dark regions 11D that the field of view of the opticalsensor 13 passes. In the case that the optical sensor 13 is arrangedright above the detected surface 11 and facing the detected surface 11perpendicularly, the field of view of the optical sensor 13 overlaps theoptical sensor 13 in the vertical direction such that when an edgepasses the FOV, said edge also passes the optical sensor 13.

In the present disclosure, a type of edge is determined or calculated bythe processor 15. For example, a bright-to-dark edge (shown as B2DE inFIGS. 2-5) is determined when brightness of a left part of the imageframe IF captured by the optical sensor 13 is higher than that of aright part of the image frame IF; and a dark-to-bright edge isdetermined (shown as D2BE in FIGS. 2-5) when brightness of the left partof the image frame IF is lower than that of the right part of the imageframe IF. The definition of the B2DE and D2BE may be arranged inopposite.

Referring to FIGS. 2 to 4, they are operational schematic diagrams of anoptical positioning system 100 according to some embodiments of thepresent disclosure. For example, if the field of view of the opticalsensor 13 sequentially passes a bright-to-dark edge and a dark-to-brightedge, the counter 17 increases a number of edge pairs (i.e. line count)by 1 as shown in FIG. 2. On the other hand, if the field of view of theoptical sensor 13 sequentially passes a dark-to-bright edge and abright-to-dark edge, the counter 17 decreases a number of edge pairs(i.e. line count) by 1 as shown in FIG. 4. That is, the edge pairsherein include two different edges D2BE and B2DE. The increment anddecrement of the counted number of edge pairs may be arranged inopposite.

FIG. 5 shows that the FOV moves from left to right at first and thenstops at position 4.5. As mentioned above since the FOV passes two edgepairs, the counted number of edge pairs is equal to 2. Although the FOValso passes another B2DE at position 4, the line count is not increasedby passing only one edge. After that, the FOV moves back from right toleft, and then passes the B2DE at position 4 again. In this moment, theline count is not decreased or increased since the predetermined edgepairs (i.e. two different edges) are not recognized by the processor 13.After that, when the FOV passes D2BE at position 3 and B2DE at position2, the line count is decreased by 1, and so on.

In the present disclosure, the optical positioning system 100 furtherincludes a register, arranged in or out of the processor 15, forrecording a type of a last passed edge. For example, the register uses adigital value “1” to indicate the last passed edge as a B2DE (or D2BE),and uses another digital value “0” to indicate the last passed edge as aD2BE (or B2DE). It is appreciated that a bit number recorded by theregister is not limited to one bit. For example in FIG. 3, if the FOV isfocused on E, the last passed edge is B2DE at position 2 since themoving direction is toward right. On the contrary, if the FOV is focusedon F as shown in FIGS. 4 and 5, the last passed edge is D2BE at position3 since the moving direction is toward left.

The processor 15 is an application specific integrated circuit (ASIC),digital signal processor (DSP) or a microcontroller unit (MCU). Inaddition to determine an edge type (B2DE and D2BE) as mentioned above,the processor 15 further calculates an average value of the image frameIF captured by the optical sensor 13, wherein the average value is anaverage raw data or average gray levels of all pixels of the image frameIF. As shown in FIGS. 2-5, the processor 13 distinguishes the positionof FOV being aligned with an edge or not aligned with any edge so as toselect the formula for calculation.

As mentioned above, the processor 15 determines whether the field ofview is aligned with an edge between the bright regions 11B and the darkregions 11D according to a brightness distribution in the image frame IFacquired by the optical sensor 13. Furthermore, the processor 15compares a ratio between an average value of the image frame IF and ashutter time of the optical sensor 13 with a ratio threshold todetermine whether the field of view is aligned with one of the brightregions 11B or the dark regions 11D if it is not aligned with an edge.

The memory 19 is a volatile and/or non-volatile memory. The memory 19 isused to store the ratio threshold, parameters and algorithms (e.g.,formulas if the processor 15 is responsible for calculating theposition) used in operation.

In the present disclosure, the processor 15 determines an integerposition according to the counted number of edge pairs without using thelast passed edge or the ratio when a field of view of the optical sensor13 is determined to be aligned with one edge. For example, when thefield of view of the optical sensor 13 is aligned with a bright-to-darkedge, the processor 15 calculates the integer position using a formula(1):

2×the counted number of edge pairs×the identical width  (1)

Referring to FIG. 2 again, for location B, the processor 15 obtains 2 mm(e.g., absolute position or relative position from position 0) bycalculating (2×1)×1 mm, wherein the line count corresponding to locationB is 1 and a mark width is 1 mm. For location C, the processor 15obtains 4 mm by calculating (2×2)×1 mm since the line countcorresponding to location C is 2.

However, when the field of view of the optical sensor 13 is aligned withthe dark-to-bright edge, the processor 15 calculates the integerposition using a formula (2):

(2×the counted number of edge pairs−1)×the identical width  (2)

Referring to FIG. 2 again, for location A, the processor 15 obtains 1 mmby calculating (2×1−1)×1 mm since the line count corresponding tolocation A is 1.

In the present disclosure, the processor 15 further determines a halfposition according to the number of edge pairs (i.e. line count) countedby the counter 17, the last passed edge (recorded in the register) andthe ratio between an average value of the image frame IF and a shuttertime of the optical sensor 13 calculated by the processor 15 when thefield of view is determined to be aligned with one of the bright regions11B or the dark regions 11D.

For example, when the ratio is larger than a ratio threshold, it meansthat the FOV of the optical sensor 13 is aligned with one of the brightregions 11B. The processor 15 then calculates the half position using aformula (3):

(2×the counted number of edge pairs−0.5)×the identical width  (3)

Referring to FIG. 3 again, for location D, the processor 15 obtains 1.5mm by calculating (2×1−0.5)×1 mm since the line count corresponding tolocation D is 1. Referring to FIGS. 4 and 5 again, for location G, theprocessor 15 obtains 1.5 mm by calculating (2×1−0.5)×1 mm since the linecount corresponding to location G is also 1.

In addition, when the ratio is smaller than the ratio threshold, itmeans that the FOV of the optical sensor 13 is aligned with one of thedark regions 11D. In the case that the last passed edge recorded by theregister is the bright-to-dark edge, the processor 15 calculates thehalf position using a formula (4):

(2×the counted number of edge pairs+0.5)×the identical width  (4)

Referring to FIG. 3 again, for location E, the processor 15 obtains 2.5mm by calculating (2×1+0.5)×1 mm since the line count corresponding tolocation E is 1 and the last passed edge is B2DE.

However, when the ratio is smaller than the ratio threshold and therecorded last passed edge is the dark-to-bright edge, the processor 15calculates the half position using a formula (5):

(2×(the counted number of edge pairs−1)+0.5)×the identical width  (5)

Referring to FIGS. 4 and 5 again, for location F, the processor 15obtains 2.5 mm by calculating (2×(2−1)+0.5)×1 mm since the line countcorresponding to location F is 2 and the last passed edge is D2BE.

Referring to FIG. 6, it is a flow chart of an operating method of anoptical positioning system 100 according to one embodiment of thepresent disclosure. In the present disclosure, the processor 15calculates a current position using different formulas when the FOV ofthe optical sensor 13 is aligned with different edge types, a brightregion 11B or a dark region 11D.

Step S61: When the optical positioning system 100 is in operation, theoptical sensor 13 captures, at a predetermined frequency, image framesIF of the detected surface 11 within a field of view thereof using ashutter time. The processor 15 receives and reads raw data or graylevels of every pixel in every image frame IF from the optical sensor13, and calculates an average value of every image frame IF. Inaddition, the counter 17 continuously counts a number of edge pairsbetween the bright regions 11B and the dark regions 11D that the fieldof view of the optical sensor 13 passes in a transverse direction.

Step S62: The processor 15 determines whether the field of view of theoptical sensor 15 is aligned with an edge between the bright regions 11Band the dark regions 11D according to a brightness distribution in theimage frame IF. For example, when the image frame IF contains a verticaledge between a left part (bright or dark) and a right part (dark orbright) of the image frame IF (e.g., referring to FIG. 2), the processor15 determines that the optical sensor 15 is on one edge (assuming theoptical sensor 15 overlapping the FOV).

Step S63: The processor 15 recognizes different edges as mentionedabove.

Step S631: When determining that a current edge is B2DE, e.g., locationsB and C in FIG. 2, the processor 15 calculates a current position usingformula (1) as mentioned above.

Step S632: When determining that a current edge is D2BE, e.g., locationA in FIG. 2, the processor 15 calculates a current position usingformula (2) as mentioned above.

On the other hand, if the processor 15 determines that the opticalsensor 15 is not on any edge, then the processor 15 determines whetherthe optical sensor 15 is on a dark region 11D (e.g., mark) or a brightregion 11B (e.g., space).

Step S64: As mentioned above, the processor 15 calculates a ratiobetween an average value of the image frame IF and a shutter time of theoptical sensor 13, i.e., the average value divided by the shutter time.

Step S641: When the calculated ratio is larger than a predeterminedratio threshold stored in the memory 19, the processor 15 determinesthat the field of view of the optical sensor 13 is aligned with one ofthe bright regions 11B, and calculates a current position using formula(3) as mentioned above.

Table I shows one example of the calculated average value and theshutter time when the FOV is on the mark and the space. In this case,the predetermined ratio threshold is selected as 0.75. All values inTable I are determined before shipment of the optical positioning system100.

TABLE I Location Average Value Shutter Time Ratio Mark about 100 about400 about 0.25 Space about 120 about 80 About 1.50

Step S65: When the calculated ratio is smaller than a predeterminedratio threshold stored in the memory 19, the processor 15 determinesthat the field of view of the optical sensor 13 is aligned with one ofthe dark regions 11D. The processor 15 determines a current positionfurther according to a last passed edge recorded in the register. Whenthe field of view of the optical sensor 13 is aligned with one of thedark regions 11D and a last passed edge is the bright-to-dark edge, theprocessor 15 calculates the current position using formula (4) asmentioned above. However, when the field of view of the optical sensor13 is aligned with one of the dark regions 11D and a last passed edge isthe dark-to-bright edge, the processor 15 calculates the currentposition using formula (5) as mentioned above.

In the above embodiment, the processor 15 determines a moving directionof a field of view of the optical sensor 13 according to a last passededge recorded in the register. In other embodiments, the processor 15directly calculates the moving direction according to increment ordecrement of a higher brightness area, which corresponds to the brightregion 11B, or a lower brightness area, which corresponds to the darkregion 11D, between the captured image frames. For example, if theprocessor 15 continuously recognizes a dark region (i.e. lowerbrightness area) at a left side of successive image frames IF and anarea of said dark region decreases with time, the processor 15determines that the field of view of the optical sensor 13 moves in aright direction and the register is used to record a digital valueindicating said right direction. On the contrary, if an area of saiddark region increases with time, the processor 15 determines that thefield of view of the optical sensor 13 moves in a left direction and theregister is used to record another digital value indicating said leftdirection.

One of ordinary skill in the art would understand that the method ofusing the increment and decrement of a bright region in successive imageframes IF to determine a moving direction is similar to using the darkregion mentioned above, and thus details thereof are not repeatedherein.

In this embodiment, arrangements of the detected surface 11, the opticalsensor 13 and the counter 17 are identical to those mentioned above. Thedifference between this embodiment and the above embodiment is that thelast passed edge is replaced by a moving direction, wherein both thelast passed edge and the moving direction are obtained by the processor15 and may be indicated by a digital value recorded in the register.

In this embodiment, the processor 15 calculates an average value of acurrent image frame captured by the optical sensor 13 and calculates amoving direction according to multiple image frames IF. The processor 15determines whether the field of view is aligned with an edge between thebright regions 11B and the dark regions 11D according to a brightnessdistribution in the current image frame, which has been described aboveand thus details thereof are not repeated herein. When the field of viewis determined to be aligned with one edge, the processor 15 determinesand calculates an integer position according to the counted number ofedge pairs without using the moving direction or the ratio, e.g., usingformulas (1) and (2) in FIG. 7.

If the field of view is determined not to be aligned with any edge, theprocessor 15 compares a ratio between an average value of the currentimage frame and a shutter time of the optical sensor 13 with a ratiothreshold stored in the memory 19 to determine whether the field of viewof the optical sensor 13 is aligned with one of the bright regions 11Bor the dark regions 11D.

The processor 15 determines a half position according to the countednumber of edge pairs, the moving direction and the ratio when the fieldof view is determined to be aligned with one of the bright regions 11Bor the dark regions 11D. For example, when the ratio is larger than theratio threshold, it means that the optical sensor 13 is on a brightregion 11B (assuming the optical sensor 13 overlapping the FOV thereof),the processor 15 calculates the half position using formula (3) asmentioned above, referring to FIG. 7.

When the ratio is smaller than the ratio threshold, it means that theoptical sensor 13 is on a dark region 11D. When the moving direction isa right direction, the processor 15 calculates the half position usingformula (4) as mentioned above, referring to FIG. 7. On the other hand,when the moving direction is a left direction, the processor 15calculates the half position using formula (5) as mentioned above,referring to FIG. 7.

FIG. 7 is an operating method of an optical positioning system 100 ofthis embodiment. The steps identical to FIG. 6 are indicated by the samereference numbers. It is seen that only steps S75, S751 and S752 aredifferent because a moving direction is used in operation instead ofusing the last passed edge.

It should be mentioned that although FIGS. 2-5 show that mark edgesindicate integer positions, and marks (e.g., dark regions 11D) andspaces (e.g., bright regions 11B) indicate half positions, it is onlyintended to illustrate but not to limit the present disclosure. In otheraspects, if the FOV starts at a point within a mark or a space, the markedges are arranged to indicate a half position, and the marks and spacesare arranged to indicate an integer position.

In other embodiments, the optical positioning system 100 of the presentdisclosure further includes a light source (e.g., infrared LED, but notlimited to) to illuminate the detected surface 11 having the marks 11Dthereon to enhance contrast of the captured image frames IF.

It is appreciated that if the ratio mentioned above is calculated bydividing a shutter time of optical sensor 13 by an average value ofimage frame IF, the relationship between the ratio and the ratiothreshold is reversed.

As mentioned above, an optical positioning system can detect a positionof an optical sensor corresponding to a surface having marks. Thepresent disclosure provides an optical positioning system (e.g., FIG. 1)and an operating method thereof (e.g., FIGS. 6-7) that can furtherdetermine an absolute position of an optical sensor corresponding todark regions (at marks) and bright regions (not at marks) to double thepositional accuracy.

Although the disclosure has been explained in relation to its preferredembodiment, it is not used to limit the disclosure. It is to beunderstood that many other possible modifications and variations can bemade by those skilled in the art without departing from the spirit andscope of the disclosure as hereinafter claimed.

What is claimed is:
 1. An optical positioning system, comprising: adetected surface having interleaved bright regions and dark regionsarranged in a transverse direction; an optical sensor configured tocapture an image frame of the detected surface within a field of viewthereof and using a shutter time, wherein the detected surface and theoptical sensor are configured to have a relative movement in thetransverse direction; a counter configured to count a number of edgepairs between the bright regions and the dark regions that the field ofview passes; a register configured to record a type of a last passededge; and a processor configured to calculate an average value of theimage frame, determine whether the field of view is aligned with an edgebetween the bright regions and the dark regions according to abrightness distribution in the image frame, compare a ratio between theaverage value and the shutter time with a ratio threshold to determinewhether the field of view is aligned with one of the bright regions orthe dark regions, determine an integer position according to the countednumber of edge pairs without using the last passed edge or the ratiowhen the field of view is determined to be aligned with the edge, anddetermine a half position according to the counted number of edge pairs,the last passed edge and the ratio when the field of view is determinedto be aligned with one of the bright regions or the dark regions.
 2. Theoptical positioning system as claimed in claim 1, wherein the brightregions and the dark regions have an identical width in the transversedirection; and the field of view of the optical sensor in the transversedirection is smaller than the identical width.
 3. The opticalpositioning system as claimed in claim 1, wherein a bright-to-dark edgeis determined when brightness of a left part of the image frame ishigher than that of a right part of the image frame, and adark-to-bright edge is determined when the brightness of the left partof the image frame is lower than that of the right part of the imageframe.
 4. The optical positioning system as claimed in claim 3, whereinwhen the field of view sequentially passes the bright-to-dark edge andthe dark-to-bright edge, the counted number of edge pairs is increasedby 1, and when the field of view sequentially passes the dark-to-brightedge and the bright-to-dark edge, the counted number of edge pairs isdecreased by
 1. 5. The optical positioning system as claimed in claim 3,wherein the bright regions and the dark regions have an identical widthin the transverse direction, when the field of view is aligned with thebright-to-dark edge, the processor is configured to calculate theinteger position using 2×(the counted number of edge pairs−1)×theidentical width, and when the field of view is aligned with thedark-to-bright edge, the processor is configured to calculate theinteger position using 2×(the counted number of edge pairs−1)×theidentical width.
 6. The optical positioning system as claimed in claim3, wherein the bright regions and the dark regions have an identicalwidth in the transverse direction, and when the ratio is larger than theratio threshold, the processor is configured to calculate the halfposition using (2×the counted number of edge pairs−0.5)×the identicalwidth.
 7. The optical positioning system as claimed in claim 3, whereinthe bright regions and the dark regions have an identical width in thetransverse direction, when the ratio is smaller than the ratio thresholdand the recorded last passed edge is the bright-to-dark edge, theprocessor is configured to calculate the half position using (2×thecounted number of edge pairs+0.5)×the identical width, and when theratio is smaller than the ratio threshold and the recorded last passededge is the dark-to-bright edge, the processor is configured tocalculate the half position using (2×(the counted number of edgepairs−1)+0.5)×the identical width.
 8. An optical positioning system,comprising: a detected surface having interleaved bright regions anddark regions arranged in a transverse direction; an optical sensorconfigured to capture image frames of the detected surface within afield of view thereof and using a shutter time, wherein the detectedsurface and the optical sensor are configured to have a relativemovement in the transverse direction; a counter configured to count anumber of edge pairs between the bright regions and the dark regionsthat the field of view passes; a processor configured to calculate anaverage value of a current image frame and a moving direction accordingto multiple image frames, determine whether the field of view is alignedwith an edge between the bright regions and the dark regions accordingto a brightness distribution in the current image frame, compare a ratiobetween the average value and the shutter time with a ratio threshold todetermine whether the field of view is aligned with one of the brightregions or the dark regions, determine an integer position according tothe counted number of edge pairs without using the moving direction orthe ratio when the field of view is determined to be aligned with theedge, and determine a half position according to the counted number ofedge pairs, the moving direction and the ratio when the field of view isdetermined to be aligned with one of the bright regions or the darkregions.
 9. The optical positioning system as claimed in claim 8,wherein the bright regions and the dark regions have an identical widthin the transverse direction; and the field of view of the optical sensorin the transverse direction is smaller than the identical width.
 10. Theoptical positioning system as claimed in claim 8, wherein abright-to-dark edge is determined when brightness of a left part of thecurrent image frame is higher than that of a right part of the currentimage frame, and a dark-to-bright edge is determined when the brightnessof the left part of the current image frame is lower than that of theright part of the current image frame.
 11. The optical positioningsystem as claimed in claim 10, wherein when the field of viewsequentially passes the bright-to-dark edge and the dark-to-bright edge,the counted number of edge pairs is increased by 1, and when the fieldof view sequentially passes the dark-to-bright edge and thebright-to-dark edge, the counted number of edge pairs is decreased by 1.12. The optical positioning system as claimed in claim 10, wherein thebright regions and the dark regions have an identical width in thetransverse direction, when the field of view is aligned with thebright-to-dark edge, the processor is configured to calculate theinteger position using 2×the counted number of edge pairs×the identicalwidth, and when the field of view is aligned with the dark-to-brightedge, the processor is configured to calculate the integer positionusing 2×(the counted number of edge pairs−1)×the identical width. 13.The optical positioning system as claimed in claim 10, wherein thebright regions and the dark regions have an identical width in thetransverse direction, and when the ratio is larger than the ratiothreshold, the processor is configured to calculate the half positionusing (2×the counted number of edge pairs−0.5)×the identical width. 14.The optical positioning system as claimed in claim 10, wherein thebright regions and the dark regions have an identical width in thetransverse direction, when the ratio is smaller than the ratio thresholdand the moving direction is a right direction, the processor isconfigured to calculate the half position using (2×the counted number ofedge pairs+0.5)×the identical width, and when the ratio is smaller thanthe ratio threshold and the moving direction is a left direction, theprocessor is configured to calculate the half position using (2×(thecounted number of edge pairs-1)+0.5)×the identical width.
 15. Theoptical positioning system as claimed in claim 8, wherein the processoris configured to calculate the moving direction according to incrementor decrement of a high brightness area corresponding to the brightregion or a low brightness area corresponding to the dark region betweenthe multiple image frames.
 16. An operating method of an opticalpositioning system, the optical positioning system comprising a detectedsurface, an optical sensor and a processor, the operating methodcomprising: capturing an image frame of the detected surface, which hasinterleaved bright regions and dark regions, within a field of view ofthe optical sensor using a shutter time; counting, by the processor, anumber of edge pairs between the bright regions and the dark regionsthat the field of view passes in a transverse direction; calculating, bythe processor, an average value of the image frame; calculating, by theprocessor, a ratio between the calculated average value and the shuttertime; determining that the field of view is aligned with one of the darkregions when the ratio is smaller than a predetermined ratio threshold;and determining that the field of view is aligned with one of the brightregions when the ratio is larger than the predetermined ratio threshold.17. The operating method as claimed in claim 16, wherein the brightregions and the dark regions have an identical width in the transversedirection; and the field of view of the optical sensor in the transversedirection is smaller than the identical width.
 18. The operating methodas claimed in claim 16, wherein a bright-to-dark edge is determined whenbrightness of a left part of the image frame is higher than that of aright part of the image frame, and a dark-to-bright edge is determinedwhen the brightness of the left part of the image frame is lower thanthat of the right part of the image frame.
 19. The operating method asclaimed in claim 18, wherein the bright regions and the dark regionshave an identical width in the transverse direction, and the operatingmethod further comprises: calculating a position using (2×the countednumber of edge pairs−0.5)×the identical width when the field of view isaligned with one of the bright regions; calculating a position using(2×the counted number of edge pairs+0.5)×the identical width when thefield of view is aligned with one of the dark regions and a last passededge is the bright-to-dark edge; and calculating the position using(2×(the counted number of edge pairs−1)+0.5)×the identical width whenthe field of view is aligned with one of the dark regions and a lastpassed edge is the dark-to-bright edge.
 20. An optical positioningsystem, comprising: a detected surface having interleaved bright regionsand dark regions; an optical sensor configured to capture an image frameof the detected surface within a field of view thereof and using ashutter time, and a processor configured to count a number of edge pairsbetween the bright regions and the dark regions that the field of viewpasses in a transverse direction, calculate an average value of theimage frame and a ratio of the calculated average value to the shuttertime, determine that the field of view is aligned with one of the darkregions when the ratio is smaller than a predetermined ratio threshold,and determine that the field of view is aligned with one of the brightregions when the ratio is larger than the predetermined ratio threshold.